home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-02 | 1.5 KB | 61 lines | [TEXT/PJMM] |
- {===============================================}
- {================= Point sprite unit ================}
- {===============================================}
-
- { Example file for Ingemars Sprite Animation Toolkit. }
- { © Ingemar Ragnemalm 1992 }
- { See doc files for legal terms for using this code. }
-
- unit sPoints;
-
- { Sprite unit. A Sprite unit should include the following routines:}
- { Init-procedure, that initializes private bitmaps}
- { Setup-procedure, that sets variables other than the standard ones set by MakeSprite }
- { Handle-procedure, to be called once per iteration until the sprite dies }
- { Hittask-procedure (optional), for advanced collission handling. }
-
- { This object is a non-moving, flashing number, used to indicate that the player}
- { has caught a bonus object. }
-
- interface
-
- uses
- {$IFC UNDEFINED THINK_PASCAL}
- Types, Quickdraw,
- {$ENDC}
- SAT, GameGlobals;
-
- procedure InitPoints;
- procedure SetupPoints (mp: SpritePtr);
- procedure HandlePoints (me: SpritePtr);
-
- implementation
-
- var
- PointsFace, fPointsFace: FacePtr;
-
- procedure InitPoints;
- begin
- fPointsFace := SATGetFace(132);
- PointsFace := SATGetFace(131);
- end;
-
- procedure SetupPoints (mp: SpritePtr);
- begin
- mp^.face := PointsFace;
- mp^.task := @HandlePoints;
- end;
-
- procedure HandlePoints (me: SpritePtr);
- begin
- me^.mode := me^.mode + 1;
- if (me^.mode > 32) or (band(me^.mode, 8) = 0) then
- me^.face := PointsFace
- else
- me^.face := fPointsFace;
-
- if me^.mode > 60 then
- me^.task := nil;
- end;
-
- end.